#include "command.h"

void handle_command(int netFD, sendc_t sc){
    char buf[1024] = { 0 };
    switch(sc.num){
    case 1:
        cd(sc.path, buf);
        break;
    case 2:
        ls(buf, sizeof(buf), sc.path);
        break;
    case 3:
        pwd(buf, sizeof(buf), sc.path);
        break;
    case 4:
        remove_file(sc.path, buf);
        break;
    case 5:
        gets_file(netFD, sc.path);
        break;
    case 6:
        puts_file(netFD, sc.path);
    }
    int ret = send(netFD, buf, strlen(buf), MSG_WAITALL);
    ERROR_CHECK(ret, -1, "send_msg_handleCommand.c");
}
